{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,18,18,18,126,136,175,26,166,255,247,127,0,0,0,0,0,0,0,0,0,0,0,0,30,36,94,154,170,253,253,253,253,253,225,172,253,242,195,64,0,0,0,0,0,0,0,0,0,0,0,49,238,253,253,253,253,253,253,253,253,251,93,82,82,56,39,0,0,0,0,0,0,0,0,0,0,0,0,18,219,253,253,253,253,253,198,182,247,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,156,107,253,253,205,11,0,43,154,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,1,154,253,90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,139,253,190,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,190,253,70,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,241,225,160,108,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,81,240,253,253,119,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,186,253,253,150,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,93,252,253,187,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,253,249,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,130,183,253,253,207,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,148,229,253,253,253,250,182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,114,221,253,253,253,253,201,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,66,213,253,253,253,253,198,81,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,171,219,253,253,253,253,195,80,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,172,226,253,253,253,253,244,133,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,136,253,253,253,212,135,132,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\\n'"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datafile = open(\"train.csv\",'r')\n",
    "datalist = datafile.readlines()\n",
    "datafile.close()\n",
    "datalist[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   3,\n",
       "         18,  18,  18, 126, 136, 175,  26, 166, 255, 247, 127,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,  30,  36,  94, 154, 170,\n",
       "        253, 253, 253, 253, 253, 225, 172, 253, 242, 195,  64,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,  49, 238, 253, 253, 253, 253,\n",
       "        253, 253, 253, 253, 251,  93,  82,  82,  56,  39,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,  18, 219, 253, 253, 253, 253,\n",
       "        253, 198, 182, 247, 241,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,  80, 156, 107, 253, 253,\n",
       "        205,  11,   0,  43, 154,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,   0,  14,   1, 154, 253,\n",
       "         90,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, 139, 253,\n",
       "        190,   2,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,  11, 190,\n",
       "        253,  70,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,  35,\n",
       "        241, 225, 160, 108,   1,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "         81, 240, 253, 253, 119,  25,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,  45, 186, 253, 253, 150,  27,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0,  16,  93, 252, 253, 187,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0,   0,   0, 249, 253, 249,  64,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,  46, 130, 183, 253, 253, 207,   2,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,  39,\n",
       "        148, 229, 253, 253, 253, 250, 182,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,  24, 114, 221,\n",
       "        253, 253, 253, 253, 201,  78,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,  23,  66, 213, 253, 253,\n",
       "        253, 253, 198,  81,   2,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,  18, 171, 219, 253, 253, 253, 253,\n",
       "        195,  80,   9,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,  55, 172, 226, 253, 253, 253, 253, 244, 133,\n",
       "         11,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0, 136, 253, 253, 253, 212, 135, 132,  16,   0,\n",
       "          0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0]], dtype=int16)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "all_value = datalist[0].split(',')\n",
    "img = np.array(all_value[1:],dtype=np.int16).reshape(28,-1)\n",
    "img"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x26b938fcd88>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgo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1m9paZ7TSzQueXzubQO2hmu4Ysu9jMnjOz97PbinPsFdTbPWb2l+y522lm8wvqbaqZbTezPWa228x+ni0v9LlL9NWS563l79nNbJSk9yT9q6R+Sa9IWuLub7e0kSrMrE9Syd0LPwHDzGZJOiLpt+5+VbbsQUmfuvvK7B/KCe7+723S2z2SjhQ9jXc2W9GUodOMS1oo6Scq8LlL9PVvasHzVsSRfbqkD9z9I3f/m6TfS1pQQB9tz91fkPTpaYsXSFqf3V+vwT+WlqvSW1tw9/3u/lp2/wtJp6YZL/S5S/TVEkWE/VJJe4c87ld7zffukraa2atm1l10MxVMdvf90uAfj6RJBfdzuprTeLfSadOMt81zV8/0540qIuyVppJqp/G/Ge4+TdINkm7LXq5ieIY1jXerVJhmvC3UO/15o4oIe7+kqUMef1vSvgL6qMjd92W3ByVtUvtNRX3g1Ay62e3Bgvv5f+00jXelacbVBs9dkdOfFxH2VyRdZmbfMbMxkn4kaUsBfXyDmV2YfXAiM7tQ0ly131TUWyQtze4vlbS5wF6+pl2m8a42zbgKfu4Kn/7c3Vv+I2m+Bj+R/1DSfxTRQ5W+/lHSG9nP7qJ7k/S4Bl/W/V2Dr4iWSbpE0jZJ72e3F7dRb/8t6S1Jb2owWFMK6u06Db41fFPSzuxnftHPXaKvljxvnC4LBMEZdEAQhB0IgrADQRB2IAjCDgRB2IEgCDsQxP8BwfxNbNfq1cUAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "plt.imshow(img,cmap='Greys', interpolation='None')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.02164706, 0.07988235, 0.07988235,\n",
       "        0.07988235, 0.49917647, 0.538     , 0.68941176, 0.11094118,\n",
       "        0.65447059, 1.        , 0.96894118, 0.50305882, 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.12647059, 0.14976471,\n",
       "        0.37494118, 0.60788235, 0.67      , 0.99223529, 0.99223529,\n",
       "        0.99223529, 0.99223529, 0.99223529, 0.88352941, 0.67776471,\n",
       "        0.99223529, 0.94952941, 0.76705882, 0.25847059, 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.20023529, 0.934     , 0.99223529,\n",
       "        0.99223529, 0.99223529, 0.99223529, 0.99223529, 0.99223529,\n",
       "        0.99223529, 0.99223529, 0.98447059, 0.37105882, 0.32835294,\n",
       "        0.32835294, 0.22741176, 0.16141176, 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.07988235, 0.86023529, 0.99223529,\n",
       "        0.99223529, 0.99223529, 0.99223529, 0.99223529, 0.77870588,\n",
       "        0.71658824, 0.96894118, 0.94564706, 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.32058824, 0.61564706,\n",
       "        0.42541176, 0.99223529, 0.99223529, 0.80588235, 0.05270588,\n",
       "        0.01      , 0.17694118, 0.60788235, 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.06435294,\n",
       "        0.01388235, 0.60788235, 0.99223529, 0.35941176, 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.54964706, 0.99223529, 0.74764706, 0.01776471,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.05270588, 0.74764706, 0.99223529, 0.28176471,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.14588235, 0.94564706, 0.88352941,\n",
       "        0.63117647, 0.42929412, 0.01388235, 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.32447059, 0.94176471,\n",
       "        0.99223529, 0.99223529, 0.472     , 0.10705882, 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.18470588,\n",
       "        0.73211765, 0.99223529, 0.99223529, 0.59235294, 0.11482353,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.07211765, 0.37105882, 0.98835294, 0.99223529, 0.736     ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.97670588, 0.99223529, 0.97670588,\n",
       "        0.25847059, 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.18858824,\n",
       "        0.51470588, 0.72047059, 0.99223529, 0.99223529, 0.81364706,\n",
       "        0.01776471, 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.16141176, 0.58458824, 0.89905882,\n",
       "        0.99223529, 0.99223529, 0.99223529, 0.98058824, 0.71658824,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.10317647, 0.45258824, 0.868     , 0.99223529, 0.99223529,\n",
       "        0.99223529, 0.99223529, 0.79035294, 0.31282353, 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.09929412, 0.26623529,\n",
       "        0.83694118, 0.99223529, 0.99223529, 0.99223529, 0.99223529,\n",
       "        0.77870588, 0.32447059, 0.01776471, 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.07988235, 0.67388235, 0.86023529, 0.99223529,\n",
       "        0.99223529, 0.99223529, 0.99223529, 0.76705882, 0.32058824,\n",
       "        0.04494118, 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.22352941,\n",
       "        0.67776471, 0.88741176, 0.99223529, 0.99223529, 0.99223529,\n",
       "        0.99223529, 0.95729412, 0.52635294, 0.05270588, 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.538     ,\n",
       "        0.99223529, 0.99223529, 0.99223529, 0.83305882, 0.53411765,\n",
       "        0.52247059, 0.07211765, 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ],\n",
       "       [0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      , 0.01      , 0.01      ,\n",
       "        0.01      , 0.01      , 0.01      ]])"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "scaled = img/255.0 * 0.99 + 0.01\n",
    "scaled"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>7</th>\n",
       "      <th>8</th>\n",
       "      <th>9</th>\n",
       "      <th>...</th>\n",
       "      <th>775</th>\n",
       "      <th>776</th>\n",
       "      <th>777</th>\n",
       "      <th>778</th>\n",
       "      <th>779</th>\n",
       "      <th>780</th>\n",
       "      <th>781</th>\n",
       "      <th>782</th>\n",
       "      <th>783</th>\n",
       "      <th>784</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>9</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>95</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>96</th>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>97</th>\n",
       "      <td>8</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>98</th>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>100 rows × 785 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    0    1    2    3    4    5    6    7    8    9    ...  775  776  777  778  \\\n",
       "0     5    0    0    0    0    0    0    0    0    0  ...    0    0    0    0   \n",
       "1     0    0    0    0    0    0    0    0    0    0  ...    0    0    0    0   \n",
       "2     4    0    0    0    0    0    0    0    0    0  ...    0    0    0    0   \n",
       "3     1    0    0    0    0    0    0    0    0    0  ...    0    0    0    0   \n",
       "4     9    0    0    0    0    0    0    0    0    0  ...    0    0    0    0   \n",
       "..  ...  ...  ...  ...  ...  ...  ...  ...  ...  ...  ...  ...  ...  ...  ...   \n",
       "95    0    0    0    0    0    0    0    0    0    0  ...    0    0    0    0   \n",
       "96    7    0    0    0    0    0    0    0    0    0  ...    0    0    0    0   \n",
       "97    8    0    0    0    0    0    0    0    0    0  ...    0    0    0    0   \n",
       "98    3    0    0    0    0    0    0    0    0    0  ...    0    0    0    0   \n",
       "99    1    0    0    0    0    0    0    0    0    0  ...    0    0    0    0   \n",
       "\n",
       "    779  780  781  782  783  784  \n",
       "0     0    0    0    0    0    0  \n",
       "1     0    0    0    0    0    0  \n",
       "2     0    0    0    0    0    0  \n",
       "3     0    0    0    0    0    0  \n",
       "4     0    0    0    0    0    0  \n",
       "..  ...  ...  ...  ...  ...  ...  \n",
       "95    0    0    0    0    0    0  \n",
       "96    0    0    0    0    0    0  \n",
       "97    0    0    0    0    0    0  \n",
       "98    0    0    0    0    0    0  \n",
       "99    0    0    0    0    0    0  \n",
       "\n",
       "[100 rows x 785 columns]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv(\"train.csv\",header=None)\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[5, 0, 0, ..., 0, 0, 0],\n",
       "       [0, 0, 0, ..., 0, 0, 0],\n",
       "       [4, 0, 0, ..., 0, 0, 0],\n",
       "       ...,\n",
       "       [8, 0, 0, ..., 0, 0, 0],\n",
       "       [3, 0, 0, ..., 0, 0, 0],\n",
       "       [1, 0, 0, ..., 0, 0, 0]], dtype=int64)"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_data = np.array(df)\n",
    "train_data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(100, 785)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_data.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_x = train_data[:,1:]\n",
    "y = train_data[:,0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0, 0, 0, ..., 0, 0, 0],\n",
       "       [0, 0, 0, ..., 0, 0, 0],\n",
       "       [0, 0, 0, ..., 0, 0, 0],\n",
       "       ...,\n",
       "       [0, 0, 0, ..., 0, 0, 0],\n",
       "       [0, 0, 0, ..., 0, 0, 0],\n",
       "       [0, 0, 0, ..., 0, 0, 0]], dtype=int64)"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_x = train_x.reshape(-1,28)\n",
    "train_x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "NeuralNetwork: \n",
      "input_nodes = 3, hidden_nodes = 3, \n",
      "outputnodes = 3, learningrate = 0.5\n"
     ]
    }
   ],
   "source": [
    "def sigmoid(x):\n",
    "    return 1/(1+np.exp(-x))\n",
    "\n",
    "def grad(x):\n",
    "    return x*(1-x)\n",
    "\n",
    "class NeuralNetwork:\n",
    "    \"\"\"\n",
    "    三层全连接前馈神经网络\n",
    "    \"\"\"\n",
    "    \n",
    "    def __init__(self, inputnodes, hiddennodes, outputnodes, learningrate, active_function=sigmoid, gradient=grad):\n",
    "        \"\"\"\n",
    "\n",
    "        :param inputnodes: 输入层结点数\n",
    "        :param hiddennodes: 隐藏层节点数\n",
    "        :param outputnodes: 输出层节点数\n",
    "        :param learningrate: 学习率\n",
    "        :param active_function: 激活函数\n",
    "        :param gradient: 激活函数的导数\n",
    "        \"\"\"\n",
    "        self.inputnodes = inputnodes\n",
    "        self.hiddennodes = hiddennodes\n",
    "        self.outputnodes = outputnodes\n",
    "        self.learningrate = learningrate\n",
    "        self.active_function = active_function\n",
    "        self.gradient = gradient\n",
    "        \n",
    "        # 权值矩阵\n",
    "        self.weights_i_h = np.random.rand(self.hiddennodes, self.inputnodes) - 0.5 \n",
    "        self.weights_h_o = np.random.rand(self.outputnodes, self.hiddennodes) - 0.5\n",
    "        \n",
    "    def train(self, x, y):\n",
    "        train_x = np.array(x).reshape(-1,1)\n",
    "        target = np.zeros((self.outputnodes,1)) + 0.01\n",
    "        target[y,0] = 0.99\n",
    "        \n",
    "        hiddeninputs = np.dot(self.weights_i_h, train_x)\n",
    "        hiddenoutputs = self.active_function(hiddeninputs)\n",
    "        \n",
    "        outputinputs = np.dot(self.weights_h_o, hiddenoutputs)\n",
    "        final_outputs = self.active_function(outputinputs)\n",
    "        \n",
    "        error = target - final_outputs\n",
    "        \n",
    "        hidden_error = np.dot(self.weights_h_o.transpose(), error)\n",
    "        \n",
    "        self.weights_h_o += self.learningrate * error * np.dot(self.gradient(final_outputs), hiddenoutputs.transpose())\n",
    "        \n",
    "        self.weights_i_h += self.learningrate * hidden_error * np.dot(self.gradient(hiddenoutputs), train_x.transpose()) \n",
    "    \n",
    "    def fit(self, train_x, targets):\n",
    "        train_x = np.array(train_x)\n",
    "        for i in range(train_x.shape[0]):\n",
    "            self.train(train_x[i], targets[i])\n",
    "    \n",
    "    def query(self, inputs):\n",
    "        \"\"\"单个值预测\"\"\"\n",
    "        inputs = np.array(inputs).reshape(-1,1)\n",
    "        hidden_input = np.dot(self.weights_i_h, inputs)\n",
    "        hidden_output = self.active_function(hidden_input)\n",
    "        \n",
    "        output_input = np.dot(self.weights_h_o, hidden_output)\n",
    "        \n",
    "        final_output = self.active_function(output_input)\n",
    "#         print('predict: ', final_output)\n",
    "        return np.argmax(final_output)\n",
    "    \n",
    "    def predict(self,inputs):\n",
    "        \"\"\"批量预测\"\"\"\n",
    "        res = []\n",
    "        for x in inputs:\n",
    "            res.append(self.query(x))\n",
    "        return res\n",
    "    \n",
    "    def __str__(self):\n",
    "        return \"NeuralNetwork: \\ninput_nodes = {0}, hidden_nodes = {1}, \\noutputnodes = {2}, learningrate = {3}\".format(\n",
    "            self.inputnodes, self.hiddennodes, self.outputnodes, self.learningrate\n",
    "        )\n",
    "if __name__ == '__main__':\n",
    "    nn = NeuralNetwork(3,3,3,0.5)\n",
    "    print(nn)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [],
   "source": [
    "# x缩放至较小的0.01 到 1.0的范围\n",
    "# 避免0值输入最终会人为地造成权重更新失败。\n",
    "# 没有选择0.99作为输入的上限值，因为不需要避免输入1.0会造成这个问题。\n",
    "# 只需要避免输出值为1.0。\n",
    "train_x = train_data[:,1:].reshape(-1,784)\n",
    "train_x = train_x/255.0 * 0.99 + 0.01\n",
    "y = train_data[:,0]\n",
    "nn = NeuralNetwork(train_x.shape[1], 100,10,0.3)\n",
    "nn.fit(train_x,y)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "准确度60.00%\n"
     ]
    }
   ],
   "source": [
    "# 用测试数据测试\n",
    "def accuracy(y_true, y_pred):\n",
    "    \"\"\"准确度\"\"\"\n",
    "    y_true = np.array(y_true)\n",
    "    y_pred = np.array(y_pred)\n",
    "    return sum(y_true==y_pred)/y_true.shape[0]\n",
    "test_df = pd.read_csv(\"test.csv\", header=None)\n",
    "test_data = np.array(test_df)\n",
    "test_x = test_data[:,1:].reshape(-1,784)\n",
    "test_x = test_x/255.0 * 0.99 + 0.01 \n",
    "test_y = test_data[:,0]\n",
    "y_pred = nn.predict(test_x)\n",
    "print(\"准确度%.2f%%\"%(100*accuracy(test_y, y_pred)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([7, 2, 1, 0, 4, 1, 4, 9, 5, 9], dtype=int64)"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[7, 6, 1, 0, 4, 1, 4, 3, 4, 7]"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y_pred"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "准确度93.98%\n"
     ]
    }
   ],
   "source": [
    "#用全部数据进行训练\n",
    "def get_data():\n",
    "    train_df = pd.read_csv(\"mnist_train.csv\",header=None)\n",
    "    test_df = pd.read_csv(\"mnist_test.csv\",header=None)\n",
    "    \n",
    "    train_data = np.array(train_df)\n",
    "    train_x = train_data[:,1:]\n",
    "    train_y = train_data[:,0]\n",
    "    train_x = train_x/255 *0.99  + 0.01\n",
    "    \n",
    "    test_data = np.array(test_df)\n",
    "    test_x = test_data[:,1:]\n",
    "    test_y = test_data[:,0]\n",
    "    test_x = test_x/255 * 0.99 + 0.01\n",
    "    \n",
    "    return train_x, train_y, test_x, test_y\n",
    "\n",
    "train_x, train_y, test_x, test_y = get_data()\n",
    "    \n",
    "NN = NeuralNetwork(784, 100, 10, 0.3)\n",
    "NN.fit(train_x, train_y)\n",
    "y_pred = NN.predict(test_x)\n",
    "print(\"准确度%.2f%%\"%(100*accuracy(test_y, y_pred))) \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "准确度94.77%\n"
     ]
    }
   ],
   "source": [
    "# 调整学习率\n",
    "NN = NeuralNetwork(784, 100, 10, 0.1)\n",
    "NN.fit(train_x, train_y)\n",
    "y_pred = NN.predict(test_x)\n",
    "print(\"准确度%.2f%%\"%(100*accuracy(test_y, y_pred))) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. ])"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.linspace(0.1,1,10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "学习率：0.1, 准确度：94.98%\n",
      "学习率：0.2, 准确度：94.77%\n",
      "学习率：0.3, 准确度：94.61%\n",
      "学习率：0.4, 准确度：93.34%\n",
      "学习率：0.5, 准确度：92.84%\n",
      "学习率：0.6, 准确度：91.57%\n",
      "学习率：0.7, 准确度：90.42%\n",
      "学习率：0.8, 准确度：87.95%\n",
      "学习率：0.9, 准确度：86.47%\n",
      "学习率：1.0, 准确度：85.98%\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "Text(0, 0.5, 'accuracy')"
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEGCAYAAABiq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CZ7j41PFx17C4enwCsdfceP+A1RL5DQz0STyYB/cysA4CZZZhZJ74t+ZXhd9T/s5+vMw44N/waXQkNN0UiE1hmZsnAhTvcviF8H+6+HlhgZueEf7+Z2SH7mVfijIpf4oa7lxM68ctz4eGXScBB4ROdPAZMI7Q08if7+VIPAXnh1/gl8AWhA7N7czuhg8XvAjserH0euCV80vH2hHYKV5rZVEJDUrs6paXIbmlWj0gtM7NEINndK8NF/R7QKXxuWZHAaYxfpPZlAB+Eh2wMuEalL3WJ3vGLiMQZjfGLiMQZFb+ISJxR8YuIxBkVv4hInFHxi4jEmf8HtkWY+t/U/AMAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 调整学习率\n",
    "import matplotlib.pyplot as plt\n",
    "scores = []\n",
    "for alpha in np.linspace(0.1,1,10):\n",
    "    NN = NeuralNetwork(784, 100, 10, alpha)\n",
    "    NN.fit(train_x, train_y)\n",
    "    y_pred = NN.predict(test_x)\n",
    "    score = 100*accuracy(test_y, y_pred)\n",
    "    scores.append(score)\n",
    "    print(\"学习率：%.1f, 准确度：%.2f%%\"%(alpha,score))\n",
    "plt.plot(list(np.linspace(0.1,1,10)), scores)\n",
    "plt.xlabel(\"linearing rate\")\n",
    "plt.ylabel(\"accuracy\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "第0次训练, 准确度：95.02%\n",
      "第1次训练, 准确度：94.93%\n",
      "第2次训练, 准确度：94.79%\n",
      "第3次训练, 准确度：94.88%\n",
      "第4次训练, 准确度：95.37%\n",
      "第5次训练, 准确度：95.04%\n",
      "第6次训练, 准确度：94.92%\n",
      "第7次训练, 准确度：95.04%\n",
      "第8次训练, 准确度：95.04%\n",
      "第9次训练, 准确度：94.52%\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "Text(0, 0.5, 'accuracy')"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEHCAYAAAC0pdErAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO3deXxU9dn38c812UNYkwlrIAESFlG2sAYShepjcUXrVrUuVGyFW231sYv3U23vu4ut1i5aKwquFTfqblEalE1Awr4kEGRfkxCWQMh+PX/MYAEnMEAmZ5br/XrNK8nMnHOuDEy+c37nt4iqYowxxpzM5XQBxhhjgpMFhDHGGJ8sIIwxxvhkAWGMMcYnCwhjjDE+WUAYY4zxKTqQOxeR+4C7AAGeU9U/icij3vtKvU/7uap+3Mj2UUABsFNVLz/d8VJSUjQ9Pb0pSjfGmIiwdOnSMlV1+3osYAEhIv3wBMFQoAaYKSIfeR9+UlUf92M39wGFQCt/jpmenk5BQcHZlGuMMRFJRLY29lggm5j6AItUtVJV64A5wHh/NxaRLsBlwPMBqs8YY8wpBDIg1gC5IpIsIonAOCDN+9hkEVklItNEpG0j2/8JeAhoONVBRGSiiBSISEFpaempnmqMMeYMBCwgVLUQeAyYBcwEVgJ1wDNAD2AAsBt44uRtReRyoERVl/pxnCmqmq2q2W63z2Y0Y4wxZyGgvZhUdaqqDlLVXKAcKFbVvapar6oNwHN4rlGcLAe4UkS2AK8DY0Tk1UDWaowx5kQBDQgRSfV+7QpcA0wXkY7HPWU8nqaoE6jqz1S1i6qmAzcCs1X1lkDWaowx5kQB7eYKzBCRZKAWmKSq+0XkFREZACiwBbgbQEQ6Ac+r6rgA12SMMcYPAQ0IVR3t475bG3nuLjwXsk++/3Pg86auzRhjzKnZSGpjTmHNzoN8sbHM6TKMcYQFhDGn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8OhN57lYAN1rNP5BLjTu2YIItJZRFJFpBNQqaqv4llIJ5KnAjdNzM4gTMRS1X0issC7+Pu/gI9OespM4AcisgpYDyw6h8O9DjwnIvcC3zmLWj8VkT7AQu/1i8PALUBPPBe/G4Ba4IfnUKMxJ7BursYYY3yyJiZjjDE+WUAYY4zxyQLCGGOMTxYQxhhjfLKAMMYY45MFhDHGGJ8sIIwxxvj0/wGwf6iJ22FfGAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 多次训练\n",
    "scores = []\n",
    "for i in range(10):\n",
    "    NN = NeuralNetwork(784, 100, 10, 0.1)\n",
    "    NN.fit(train_x, train_y)\n",
    "    y_pred = NN.predict(test_x)\n",
    "    score = 100*accuracy(test_y, y_pred)\n",
    "    scores.append(score)\n",
    "    print(\"第%d次训练, 准确度：%.2f%%\"%(i,score))\n",
    "plt.plot([i for i in range(1,11)], scores)\n",
    "plt.xlabel(\"train times\")\n",
    "plt.ylabel(\"accuracy\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "隐藏层10个神经元, 准确度：86.26%\n",
      "隐藏层20个神经元, 准确度：90.20%\n",
      "隐藏层50个神经元, 准确度：93.42%\n",
      "隐藏层100个神经元, 准确度：95.16%\n",
      "隐藏层200个神经元, 准确度：95.48%\n",
      "隐藏层400个神经元, 准确度：96.07%\n",
      "隐藏层800个神经元, 准确度：95.80%\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "Text(0, 0.5, 'accuracy')"
      ]
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEGCAYAAABiq/5QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACx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CHI5O3jVEMl968fVePUVd34yIQWBQ0n5gCcm0GV+JiP60li+THIzq0u0D6favp9/bSSbr+mJaBySX8gP8G/B3km4nmdTL7KQ4+G02Gyy5XSAJ6YmONyfJZI8J+FxE3DLJY8NxdI6TAlP//5lYVwOTT6d7vDrqSOZkv+iYnSN+XdJPAz8HPCLpooh49jg/32wcd/VYLesEzpe0Mr3/iyWPfZ+0C0fSVSSTiUEyWddbJC1OH1sg6bxpqOX7wM+nszC2AdcAP0i3XyNpTjrr5hsAIlkv4QlJv5DWIUkXppklYboAAACkSURBVLdXRsQD6UnsA4yfQtjshNzit5oVEUeUrFD1TUkHgB8CF6QP/zFwm6SHgPtIpsclIh6T9AckK1zVkcy0eiOw6zRreUjS35HMqAjwtxHxMICkL5DMmLqL5GBQ9Dbg42k9jSRrA2wCPiJpNcmniHvTbWZl8+ycZmY5464eM7OccfCbmeWMg9/MLGcc/GZmOePgNzPLGQe/mVnOOPjNzHLm/wPAWiAlEpkgkQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#改变隐藏层神经元个数\n",
    "scores = []\n",
    "for i in [10, 20, 50, 100, 200, 400, 800]:\n",
    "    NN = NeuralNetwork(784, i, 10, 0.1)\n",
    "    NN.fit(train_x, train_y)\n",
    "    y_pred = NN.predict(test_x)\n",
    "    score = 100*accuracy(test_y, y_pred)\n",
    "    scores.append(score)\n",
    "    print(\"隐藏层%d个神经元, 准确度：%.2f%%\"%(i,score))\n",
    "plt.plot([10, 20, 50, 100, 200, 400, 800], scores)\n",
    "plt.xlabel(\"hidden nodes\")\n",
    "plt.ylabel(\"accuracy\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
